<!DOCTYPE html>
<html>
<head>
    <title>Azure Photo Processing Solution</title>
    <style>
        body { font-family: Arial, sans-serif; max-width: 800px; margin: 0 auto; padding: 20px; }
        .question { background: #f5f5f5; padding: 15px; border-radius: 5px; margin-bottom: 20px; }
        .options { margin: 15px 0; }
        .option { margin: 10px 0; }
        button { padding: 8px 15px; background: #0078d4; color: white; border: none; border-radius: 4px; cursor: pointer; }
        .answer { display: none; margin-top: 20px; padding: 15px; background: #e6f2ff; border-radius: 5px; }
        .correct { color: green; font-weight: bold; }
    </style>
</head>
<body>
    <div class="question">
        <h3>QUESTION NO: 84</h3>
        <p>Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.</p>
        <p>After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.</p>
        
        <p>You develop a software as a service (SaaS) offering to manage photographs. Users upload photos to a web service which then stores the photos in Azure Storage Blob storage. The storage account type is General-purpose V2.</p>
        
        <p>When photos are uploaded, they must be processed to produce and save a mobile-friendly version of the image. The process to produce a mobile-friendly version of the image must start in less than one minute.</p>
        
        <p>You need to design the process that starts the photo processing.</p>
        
        <p><strong>Solution:</strong> Move photo processing to an Azure Function triggered from the blob upload.</p>
        
        <p>Does the solution meet the goal?</p>
        
        <div class="options">
            <div class="option">
                <input type="radio" id="optionA" name="answer" value="A">
                <label for="optionA">A. Yes</label>
            </div>
            <div class="option">
                <input type="radio" id="optionB" name="answer" value="B">
                <label for="optionB">B. No</label>
            </div>
        </div>
        
        <button onclick="showAnswer()">查看答案</button>
        
        <div id="answer" class="answer">
            <p><strong>正确答案：</strong> <span class="correct">A. Yes</span></p>
            
            <p><strong>解析：</strong></p>
            <ol>
                <li><strong>方案可行性</strong>：
                    <ul>
                        <li>Azure Functions支持Blob存储触发器，当新Blob创建时会立即触发（通常在几秒内）</li>
                        <li>处理流程启动时间完全满足"小于1分钟"的要求</li>
                    </ul>
                </li>
                
                <li><strong>架构优势</strong>：
                    <pre>用户上传 → Blob存储 → Function触发 → 图像处理 → 输出移动版</pre>
                    <ul>
                        <li>无服务器架构自动扩展，适合SaaS场景</li>
                        <li>General-purpose V2存储账户完美兼容</li>
                    </ul>
                </li>
                
                <li><strong>超时处理</strong>：
                    <ul>
                        <li>消耗计划默认5分钟超时（可延长至10分钟）</li>
                        <li>若处理复杂图像可能超时，建议：
                            <ul>
                                <li>使用高级/专用计划（支持30分钟以上）</li>
                                <li>或将耗时操作拆分为多个Function</li>
                            </ul>
                        </li>
                    </ul>
                </li>
            </ol>
            
            <p><strong>官方文档参考：</strong></p>
            <p>
                <a href="https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-blob-trigger" target="_blank">Blob存储触发器文档</a> |
                <a href="https://learn.microsoft.com/en-us/azure/azure-functions/functions-host-json#functiontimeout" target="_blank">Function超时配置</a>
            </p>
        </div>
    </div>

    <script>
        function showAnswer() {
            document.getElementById('answer').style.display = 'block';
            
            // 显示用户选择
            const selectedOption = document.querySelector('input[name="answer"]:checked');
            if (selectedOption) {
                const userAnswerDiv = document.createElement('div');
                userAnswerDiv.innerHTML = `<p><strong>您的选择：</strong> ${selectedOption.value}</p>`;
                document.getElementById('answer').prepend(userAnswerDiv);
            }
        }
    </script>
</body>
</html>
